Skip to content

[#27] Royalty claiming on writer dashboard#75

Merged
realproject7 merged 2 commits intomainfrom
task/27-royalty-claiming
Mar 14, 2026
Merged

[#27] Royalty claiming on writer dashboard#75
realproject7 merged 2 commits intomainfrom
task/27-royalty-claiming

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • P5-5a: New ClaimRoyalties component — shows unclaimed royalty balance per storyline via MCV2_Bond.getRoyaltyInfo(). Claim button gated behind plot_count >= 2 (anti-farming per §8)
  • P5-5b: Claim tx calls MCV2_Bond.claimRoyalties(), shows tx states, refetches balance on success
  • Added getRoyaltyInfo and claimRoyalties to mcv2BondAbi
  • All addresses from lib/contracts/constants.ts

Fixes #27

Test plan

  • Verify unclaimed balance displays per storyline
  • Verify claim button hidden when plot_count < 2
  • Verify claim tx executes and balance refreshes
  • npm run lint and npm run typecheck pass

🤖 Generated with Claude Code

Fixes #27

- P5-5a: New ClaimRoyalties component shows unclaimed balance per
  storyline via MCV2_Bond.getRoyaltyInfo(). Claim button hidden
  when plot_count < 2 (anti-farming gate per §8)
- P5-5b: Claim tx calls MCV2_Bond.claimRoyalties(), shows tx states,
  refetches balance on success
- Added getRoyaltyInfo and claimRoyalties to mcv2BondAbi
- All addresses from lib/contracts/constants.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean royalty claiming implementation:

  • getRoyaltyInfo/claimRoyalties ABI additions correct
  • Claim gated on plotCount >= 2 (anti-farming per §8)
  • No approval needed (tokens flow to user, not away)
  • Balance refetched on successful claim
  • Component hidden when no unclaimed royalties

Approved.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The royalty read/claim flow is mostly in place, but the success state does not meet the issue requirements.

Findings

  • [medium] Issue #27 explicitly requires the claim flow to show success with the claimed amount, but the current component only changes the button label to Claimed! and never displays how much royalty was actually claimed. Because refetch() happens after the tx, the pre-claim balance can also disappear immediately without ever being surfaced as the claimed amount.
    • File: src/components/ClaimRoyalties.tsx:101
    • Suggestion: Capture the pre-claim unclaimed value (or decode the claimed amount if available) before submitting the transaction and render that amount in the success state.

Decision

Requesting changes because the PR does not yet satisfy the required success UX for issue #27.

Captures unclaimed balance before claim tx and displays it in the
success button text (e.g. "Claimed 0.05 WETH").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Claimed amount now captured and displayed in success state. Approved.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The writer dashboard now exposes royalty claiming with the required plot-count gate, and the success state correctly shows the claimed amount before the balance refresh. The PR matches issue #27 and lint-and-typecheck is passing.

Findings

  • none

Decision

Approving because the royalty-claim flow now meets the ticket requirements and presents the necessary writer-facing feedback.

@realproject7 realproject7 merged commit 87e3323 into main Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P5-5] Royalty Claiming

2 participants